package com.yunsom.testdemo.design.absfactory.shape;

import com.yunsom.testdemo.design.absfactory.AbstractFactory;
import com.yunsom.testdemo.design.absfactory.color.Color;

/**
 * @author Xbao
 * @version 1.0
 * @description
 * @date 2021/3/9 17:07
 */
public class ShapeFactory extends AbstractFactory {
  @Override
  public Shape getShape(String shape){
    if(shape == null){
      return null;
    }

    if ("Circle".equalsIgnoreCase(shape)) {
      return new Circle();
    }
    if ("squre".equalsIgnoreCase(shape)){
      return new Squre();
    }
    if ("triangle".equalsIgnoreCase(shape)){
      return new Triangle();
    }
    return null;
  }

  @Override
  public Color getColor(String color) {
    return null;
  }

}
